<?php
namespace App\Controllers\Expand;

use App\Models\Expand\ExpandSource;
use App\Libs\Helper\ImageGenerate;

/**
*	推广--推广资源数据
*/

class Expand_Source extends \App\Controllers\Common\Base
{
	
	public function execute(){
		$type = (int)$this->request->get('type');//类型：1海报合成下方图 2.海报卡面图 3.链接推广图 4.语音推广语音链接
		
		$info = ExpandSource::findAll( array(
			"type = :type:",
			"bind"=>array('type'=>$type),
			'columns'=>'src,id',
		) )->toArray();
		
		/*if( $type == 1 ){
			//将查询出来的底图 系统合成
			$img = new ImageGenerate( '/static/Index/images/expand_type_empty.png' );
			$img->imageText( 35 , 0 , 40 , 90 , '我是李鹏'  );
			$img->imgMerge('/static/Index/images/erweima.png');
			$img->webShow();
			die;
		}
		*/
		
		if( empty( $info ) ){
			 return \App\Libs\Views\Json::view(0, '成功', []);
		}else{
			 return \App\Libs\Views\Json::view(0, '成功', $info);
		}
		
    }

}
